package com.example.safeassistan.home.adapter;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.safeassistan.R;
import com.example.safeassistan.home.model.OverDueTaskListModel;
import java.util.List;

public class OverDueTaskAdapter extends BaseQuickAdapter<OverDueTaskListModel.ResultDTO.RecordsDTO,BaseViewHolder> {
    public OverDueTaskAdapter(@Nullable List<OverDueTaskListModel.ResultDTO.RecordsDTO> data) {
        super(R.layout.item_overduetask_list, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, OverDueTaskListModel.ResultDTO.RecordsDTO item) {

        TextView tvType=helper.getView(R.id.tvType);
        tvType.setText(item.getCheckTypeName());
        helper.setText(R.id.tvCheckCount,0+"/"+1);

        helper.setText(R.id.tvCheckTitle,item.getDefName());
        helper.setText(R.id.tvStartTime,"检查开始时间："+item.getStartTime());
        helper.setText(R.id.tvEndTime,"检查结束时间："+item.getEndTime());
        helper.setText(R.id.tvPositionName,"执行岗位："+item.getPostName());
        tvType.setText(item.getCheckTypeName());
        if (item.getCheckFrequency()!=null){
            switch (item.getCheckFrequency()){
                case 1:
                    helper.setText(R.id.tvFrequency,"每天");
                    break;
                case 2:
                    helper.setText(R.id.tvFrequency,"每周");
                    break;
                case 3:
                    helper.setText(R.id.tvFrequency,"每月");
                    break;
                case 4:
                    helper.setText(R.id.tvFrequency,"每季");
                    break;
                case 5:
                    helper.setText(R.id.tvFrequency,"每半年");
                    break;
                case 6:
                    helper.setText(R.id.tvFrequency,"每年");
                    break;

            }
        }

    }
}